home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / IShield for Visual C++ 6.0 / DATA1.CAB / Include_Files / SDCREGU.RUL < prev    next >
Encoding:
Text File  |  1997-11-20  |  4.7 KB  |  121 lines

  1.  
  2.  /*=======================================================================*/
  3.  /*                                                                       */
  4.  /*           (c) InstallShield Software Corporation (1996-1997)          */
  5.  /*            (c)  InstallShield Corporation  (1990-1996)                */
  6.  /*                       Schaumburg, Illinois 60173                      */
  7.  /*                          All Rights Reserved                          */
  8.  /*                           InstallShield (R)                           */
  9.  /*                                                                       */
  10.  /*   File    : Sdcregu.rul                                               */
  11.  /*                                                                       */
  12.  /*   Purpose : This file contains the code for the SdConfirmRegistration */
  13.  /*             script dialog function.                                   */
  14.  /*                                                                       */
  15.  /*=======================================================================*/
  16.  
  17.  
  18.  /*------------------------------------------------------------------------*/
  19.  /*                                                                        */
  20.  /*   Function: SdConfirmRegistration                                      */
  21.  /*                                                                        */
  22.  /*   Descrip:  This dialog will confirm user of registration information. */
  23.  /*                                                                        */
  24.  /*   Misc:                                                                */
  25.  /*                                                                        */
  26.  /*------------------------------------------------------------------------*/
  27. function SdConfirmRegistration( szTitle, szName, szCompany, szSerial, nStyle )
  28.           STRING  szDlg, szTemp;
  29.           NUMBER  nId, nTemp;
  30.           BOOL    bDone;
  31.           HWND    hwndDlg;
  32.         begin
  33.  
  34.           szDlg     = SD_DLG_CONFIRMREGISTRATION;
  35.           nSdDialog = SD_NDLG_CONFIRMREGISTRATION;
  36.  
  37.           // record data produced by this dialog
  38.           if (MODE=SILENTMODE) then
  39.             SdMakeName( szAppKey, szDlg, szTitle, nSdConfirmRegistration );
  40.             SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
  41.             return nId;
  42.           endif;
  43.  
  44.           // ensure general initialization is complete
  45.           if (!bSdInit) then
  46.              SdInit();
  47.           endif;
  48.  
  49.           if (EzDefineDialog( szDlg, "", "", SD_NDLG_CONFIRMREGISTRATION ) = DLG_ERR) then
  50.             return -1;
  51.           endif;
  52.  
  53.  
  54.           // Loop in dialog until the user selects a standard button
  55.           bDone = FALSE;
  56.  
  57.           while (!bDone)
  58.  
  59.              nId = WaitOnDialog( szDlg );
  60.  
  61.              switch (nId)
  62.              case DLG_INIT:
  63.                   // assign the static text fields, assume both fonts types
  64.                   SdSetStatic( szDlg, SD_STA_NAME, szName );
  65.                   SdSetStatic( szDlg, SD_STA_COMPANY, szCompany );
  66.                   SdSetStatic( szDlg, SD_STA_SERIAL, szSerial );
  67.  
  68.                   // hide serial title text if no serial number
  69.                   if (szSerial = "") then
  70.                      CtrlSetText( szDlg, SD_STA_SERIALTITLE, "" );
  71.                   endif;
  72.  
  73.                   hwndDlg = CmdGetHwndDlg( szDlg );
  74.                   SdGeneralInit( szDlg, hwndDlg, nStyle, szSdProduct );
  75.  
  76.                   if(szTitle != "") then
  77.                        SetWindowText(hwndDlg, szTitle);
  78.                   endif;
  79.  
  80.               case BACK:
  81.                    nId    = BACK;
  82.                    bDone  = TRUE;
  83.  
  84.              case SD_PBUT_YES:
  85.                   nId     = YES;
  86.                   bDone   = TRUE;
  87.  
  88.              case SD_PBUT_NO:
  89.                   nId     = NO;
  90.                   bDone   = TRUE;
  91.  
  92.              case DLG_ERR:
  93.                   SdError( -1, "SdConfirmRegistration" );
  94.                   nId   = -1;
  95.                   bDone = TRUE;
  96.  
  97.              case DLG_CLOSE:
  98.                   SdCloseDlg( hwndDlg, nId, bDone );
  99.  
  100.              default:
  101.                   // check standard handling
  102.                   if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
  103.                      bDone = TRUE;
  104.                   endif;
  105.              endswitch;
  106.  
  107.           endwhile;
  108.  
  109.           EndDialog( szDlg );
  110.           ReleaseDialog( szDlg );
  111.  
  112.           SdUnInit( );
  113.  
  114.           // record data produced by this dialog
  115.           SdMakeName( szAppKey, szDlg, szTitle, nSdConfirmRegistration );
  116.           SilentWriteData( szAppKey, "Result", DATA_NUMBER, "", nId );
  117.  
  118.           return nId;
  119.  
  120.         end;
  121.